package com.haiyou.data.common.persister.mysql.meta;

import java.util.Map;

import lombok.ToString;

@ToString(callSuper = true)
public class DBColumnMeta extends ColumnMeta {// db里表结构信息，用于和代码表结果做对比
	private String key;
	private String def;
	private String extra;

	public String getKey(Map<String, Object> map) {
		return ((String) map.get("Key"));
	}

	public void setKey(Map<String, Object> map) {
		setKey(((String) map.get("Key")));
	}

	public String getDef(Map<String, Object> map) {
		return ((String) map.get("Default"));
	}

	public void setDef(Map<String, Object> map) {
		setDef(((String) map.get("Default")));
	}

	public String getExtra(Map<String, Object> map) {
		return ((String) map.get("Extra"));
	}

	public void setExtra(Map<String, Object> map) {
		setExtra(((String) map.get("Extra")));
	}

	public boolean isCanBeNull(Map<String, Object> map) {
		return ((String) map.get("Null")).equals("YES");
	}

	public void setCanBeNull(Map<String, Object> map) {
		setCanBeNull(((String) map.get("Null")).equals("YES"));
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getDef() {
		return def;
	}

	public void setDef(String def) {
		this.def = def;
	}

	public String getExtra() {
		return extra;
	}

	public void setExtra(String extra) {
		this.extra = extra;
	}

	@Override
	public boolean isCanBeNull() {
		return super.isCanBeNull();
	}

	@Override
	public void setCanBeNull(boolean canBeNull) {
		super.setCanBeNull(canBeNull);
	}
}
